<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Checkstatus extends CI_Controller {
	
	function __construct(){
		parent::__construct();
		$this->load->helper(array('link'));
		$this->load->model(array('menutab_model', 'apply_model'));

	}
	
	function index(){
		#get country.
		$country			=	$this->apply_model->get_country();
		
		#assign data.
		$data['country']	=	$country;
		$data['tpl_file']	=	"checkstatus";
		$this->load->view('layout/index', $data);
	}
	
	
	function check(){
			#get info.
			$country			=	$this->apply_model->get_country();
			$order_id			=	$this->input->post('order_id');

			#check status matches the id.
			$status				=	$this->menutab_model->check_status($order_id);
			if(isset($status['status'])){
				$export_status	=	$status['status'];
			}else {
				$export_status	=	"Sorry! The ID is invalid.";
			}
			#assign data.
			$data['status']		=	$export_status;
			$data['order_id']	=	$order_id;
			$data['country']	=	$country;
			
			$data['tpl_file']	=	"checkstatus";
			$this->load->view('layout/index', $data);
			
	}


}
/* End of file checkstatus.php */
/* Location: ./application/controllers/checkstatus.php */